/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "节点操作.h"

#include "ui节点面板.h"



static std::set<C_节点面板*>	g_独立更新节点;




S_选择节点	f_projectFile_取更新焦点节点() {
	return {};
}


void f_projectFile_添加焦点更新节点(C_节点面板** node, uint32 num, bool 释放清除) {
	if (释放清除) {
		g_独立更新节点.clear();

		for (uint32 i = 0; i < num; ++i) {
			g_独立更新节点.insert(node[i]);
		}
	}
	else {
		for (uint32 i = 0; i < num; ++i) {
			if (node[i]->m_NodeData) {

			}

			if (g_独立更新节点.find(node[i]) != g_独立更新节点.end()) {
				g_独立更新节点.insert(node[i]);
			}
		}
	}
}

void f_projectFile_清除焦点更新节点() {
	g_独立更新节点.clear();
}

void f_NodeOps_更新独立显示节点() {
	auto 钉住节点 = f_global_get钉住节点();
	if (钉住节点) {
		//钉住节点->m_3D视口更新(钉住节点, 0);
	}
	else {
		for (auto& e : g_独立更新节点) {
			if (e->m_3D视口更新 && e->m_NodeData && e->m_更新时间 != e->m_NodeData->m_更新时间) {

				e->m_3D视口更新(e, 0);

				e->m_更新时间 = e->m_NodeData->m_更新时间;
			}
		}
	}
	
}








